-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NwCreature - Add ForceLevelUp #792
Conversation
OnSpellBroadcast - Add Target & position parameters
NwAreaOfEffect - Add SetRadius
using System.Runtime.InteropServices; | ||
using Anvil.API.Events; | ||
using Anvil.Native; | ||
using Anvil.Services; | ||
using NWN.Core; |
Check warning
Code scanning / InspectCode
Redundant using directive Warning
OnSpellBroadcast eventData = ProcessEvent(EventCallbackType.Before, new OnSpellBroadcast | ||
{ | ||
Caster = creature.ToNwObject<NwCreature>()!, | ||
Spell = NwSpell.FromSpellId((int)nSpellId)!, | ||
ClassIndex = nMultiClass, | ||
Feat = NwFeat.FromFeatId(nFeat)!, | ||
TargetObject = oTarget, | ||
TargetPosition = oTarget is not null ? oTarget.Position : new Vector3(BitConverter.Int32BitsToSingle((int)creature.m_pExecutingAIAction.m_pParameter[6]), BitConverter.Int32BitsToSingle((int)creature.m_pExecutingAIAction.m_pParameter[7]), BitConverter.Int32BitsToSingle((int)creature.m_pExecutingAIAction.m_pParameter[8])), |
Check warning
Code scanning / InspectCode
Expression is always true according to nullable reference types' annotations Warning
OnSpellBroadcast eventData = ProcessEvent(EventCallbackType.Before, new OnSpellBroadcast | ||
{ | ||
Caster = creature.ToNwObject<NwCreature>()!, | ||
Spell = NwSpell.FromSpellId((int)nSpellId)!, | ||
ClassIndex = nMultiClass, | ||
Feat = NwFeat.FromFeatId(nFeat)!, | ||
TargetObject = oTarget, | ||
TargetPosition = oTarget is not null ? oTarget.Position : new Vector3(BitConverter.Int32BitsToSingle((int)creature.m_pExecutingAIAction.m_pParameter[6]), BitConverter.Int32BitsToSingle((int)creature.m_pExecutingAIAction.m_pParameter[7]), BitConverter.Int32BitsToSingle((int)creature.m_pExecutingAIAction.m_pParameter[8])), |
Check notice
Code scanning / InspectCode
Merge conditional ?: expression into conditional access Note
@@ -104,5 +104,17 @@ | |||
{ | |||
AreaOfEffect.AddToArea(area, x, y, z, true.ToInt()); | |||
} | |||
/// <summary> |
Check warning
Code scanning / InspectCode
Incorrect blank lines: Blank lines are missing elsewhere Warning
@@ -992,6 +992,33 @@ | |||
await WaitForObjectContext(); | |||
NWScript.ActionCounterSpell(counterSpellTarget); | |||
} | |||
/// <summary> |
Check warning
Code scanning / InspectCode
Incorrect blank lines: Blank lines are missing elsewhere Warning
/// <param name="addStatsToList">Adds the new stats to the character sheet</param> | ||
public void ForceLevelUp(byte nClass, byte nHitDie, byte nAbilityGain = 6, int bEpic = 0, ushort nSkillPointsRemaining = 0, byte nDomain1 = 255, byte nDomain2 = 255, byte nSchool = 255, int addStatsToList = 1) | ||
{ | ||
CNWLevelStats stats = new() |
Check notice
Code scanning / InspectCode
Use preferred style of 'new' expression when created type is evident Note
get => NWScript.GetAnimalCompanionName(this); | ||
set => Creature.m_pStats.m_sAnimalCompanionName = value.ToExoString(); | ||
} | ||
|
Check notice
Code scanning / InspectCode
Unnecessary whitespace at the end of line
get => (AnimalCompanionCreatureType)NWScript.GetAnimalCompanionCreatureType(this); | ||
set => Creature.m_pStats.m_nAnimalCompanionCreatureType = (int)value; | ||
} | ||
|
Check notice
Code scanning / InspectCode
Unnecessary whitespace at the end of line
{ | ||
get => NWScript.GetFamiliarName(this); | ||
set => Creature.m_pStats.m_sFamiliarName = value.ToExoString(); | ||
} |
Check warning
Code scanning / InspectCode
Incorrect indent: Around declaration braces
get => NWScript.GetFamiliarName(this); | ||
set => Creature.m_pStats.m_sFamiliarName = value.ToExoString(); | ||
} | ||
|
Check notice
Code scanning / InspectCode
Unnecessary whitespace at the end of line
public FamiliarCreatureType FamiliarType => (FamiliarCreatureType)NWScript.GetFamiliarCreatureType(this); | ||
|
||
public FamiliarCreatureType FamiliarType | ||
{ |
Check notice
Code scanning / InspectCode
Unnecessary whitespace at the end of line
7355749
to
c5811bf
Compare
Forces a PC to level up without the level up GUI